<?php
namespace app\index\controller;

use app\Logined;
use app\model\Opera as model;
use app\model\OperaCollection;
use app\model\Operalog;

class Opera extends Logined
{
    public function index()
    {
        $paginate = model::order('add_time desc')->paginate($this->param['limit'])->each(function ($item, $index){
            $item['collection_count'] = OperaCollection::where('opera_id', $item['opera_id'])->count();
        });
        return $this->success('请求成功', [
            'paginate' => $paginate
        ]);
    }



}
